﻿
namespace MelodysDemo.Core.Models
{
    /// <summary>
    /// 答题记录表
    /// </summary>
    [Table("survey_answer")]
    [Index("ClazzQuestionnaireId", Name = "clazz_questionnaire_id")]
    public partial class SurveyAnswer
    {
        public SurveyAnswer()
        {
            SurveyAnswerDetails = new HashSet<SurveyAnswerDetail>();
        }

        /// <summary>
        /// 自增主键
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }
        /// <summary>
        /// 耗时(单位：秒)
        /// </summary>
        [Column("cost_time")]
        public int CostTime { get; set; }
        /// <summary>
        /// 得分
        /// </summary>
        [Column("score")]
        public byte Score { get; set; }
        /// <summary>
        /// 班级ID
        /// </summary>
        [Column("clazz_id")]
        public long ClazzId { get; set; }
        /// <summary>
        /// 问卷ID
        /// </summary>
        [Column("questionnaire_id")]
        public long QuestionnaireId { get; set; }
        /// <summary>
        /// 教学评价ID
        /// </summary>
        [Column("clazz_questionnaire_id")]
        public long ClazzQuestionnaireId { get; set; }
        /// <summary>
        /// 来源类型(1：mobile，2：pc)
        /// </summary>
        [Column("source_type")]
        public byte SourceType { get; set; }
        /// <summary>
        /// 来源IP
        /// </summary>
        [Required]
        [Column("source_ip")]
        [StringLength(64)]
        public string SourceIp { get; set; }
        /// <summary>
        /// 来源IP地址
        /// </summary>
        [Required]
        [Column("source_location")]
        [StringLength(128)]
        public string SourceLocation { get; set; }
        /// <summary>
        /// 来源详情
        /// </summary>
        [Required]
        [Column("source_detail")]
        [StringLength(1024)]
        public string SourceDetail { get; set; }
        /// <summary>
        /// 状态（1：正常，0：无效）
        /// </summary>
        [Column("status")]
        public byte Status { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        [Column("version")]
        public long Version { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        [Required]
        [Column("creator")]
        [StringLength(64)]
        public string Creator { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Column("modified_time")]
        public DateTime ModifiedTime { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>
        [Required]
        [Column("modifier")]
        [StringLength(64)]
        public string Modifier { get; set; }
        /// <summary>
        /// 是否删除，0：否，1：是
        /// </summary>
        [Column("is_delete")]
        public byte IsDelete { get; set; }

        [ForeignKey("ClazzQuestionnaireId")]
        [InverseProperty("SurveyAnswers")]
        public virtual SurveyClazzQuestionnaire ClazzQuestionnaire { get; set; }
        [InverseProperty("Answer")]
        public virtual ICollection<SurveyAnswerDetail> SurveyAnswerDetails { get; set; }
    }
}